<!DOCTYPE html>
<html>
<head>
<title>Views</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="stylesheet" type="text/css"
	href="/codebase/fonts/font_roboto/roboto.css" />
<link rel="stylesheet" type="text/css" href="/codebase/dhtmlx.css" />
<script type="text/javascript" src="/codebase/dhtmlxform.js"></script>
<style>
/* header */
div.my_header {
	padding-bottom: 1px;
}

div.my_header div.text_block {
	height: 50px;
	line-height: 44px;
	font-size: 28px;
	color: #199BC6;
	margin-left: 5px;
	padding-left: 200px;
	background-image: url("/common/szsrcb-logo.png");
	background-repeat: no-repeat;
	background-position: center left;
}

/*content*/
div.content{
padding-left: 200px;
font-size: 28px;
}

</style>
<script>
/*<![CDATA[*/
		var myForm;
		
		function doOnLoad() {
			initForm();
		}
		function initForm() {
			if (myForm) return;
			/*
			var formData = [
				{type: "settings", position: "label-left", labelWidth: 100, inputWidth: 120,offsetLeft:200},
				
				{type: "label", name:"lable_login",label: "用户登录",offsetLeft:"150" },
				{type: "input", name:"login_name",label: "用户名", value: "",required:true},
				{type: "password", label: "密码", name:"pwd", value: "",required:true},
				//{type: "checkbox", name:"pwd",label: "Remember me", checked: true},
				{type:"button",name:"login_submit",value:"登录"}
			];
			*/
			//myForm = new dhtmlXForm("myForm", formData);
			myForm = new dhtmlXForm("myForm");
			myForm.loadStruct("/regrister_form_load");
			
			myForm.attachEvent("onButtonClick", function(name) {		
							
				if (name == "save_btn") {
					this.send("regrister_save","post",callback);		
					
				}
			/* 	if (name == "regrister") {
					window.location.pathname="regrister";
				} */
			});
			
			/* myForm.attachEvent("onKeyDown",function(inp, ev, name, value){
				if(name=='pwd' && ev.keyCode==13){
					this.send("login","post",callback);		
				}
			    
			}); */
			
		}
		
		function callback(){
			if (arguments[1]=="true"){
				alert("注册用户成功，跳转到登录界面");
				window.location.pathname="login";
			}else{			
				alert(arguments[1]);
			}
			
		}
		/*]]>*/		
	</script>
</head>
<body onload="doOnLoad();">
	<!-- header -->
	<div id="my_logo" class="my_header">
		<div class="text_block">管理系统</div>
	</div>
	<br/><br/><br/><br/>
	<div id="myForm" class="content" ></div>
</body>
</html>